<?php $conf = G('conf');?>
<?php $header = G('header');?>
<?php $user = G('user');?>
<?php $uid = G('uid');?>
<?php $gid = G('gid');?>
<?php $fid = G('fid');?>
<?php $tid = G('tid');?>
<?php $pid = G('pid');?>
<?php $route = G('route');?>
<?php $forumlist_show = G('forumlist_show');?>
<?php $static_version = $conf['static_version'];?>
<!--{hook header_start.htm}-->
<!doctype html>
<html lang="<?php echo $conf['lang'];?>">
<head>

    <?php echo defined('BASE_HREF') ? '<base href="'.BASE_HREF.'" />' : '' ;?>
    <!--{hook header_meta_before.htm}-->

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <?php if(!empty($header['keywords'])) { ?>
    <meta name="keywords" content="<?php echo strip_tags($header['keywords']);?>">
    <?php } ?>

    <meta name="description" content="<?php echo strip_tags($header['description']);?>">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">

    <title><?php echo $header['title'];?></title>
    <!--{hook header_link_before.htm}-->

    <link rel="shortcut icon" href="<?php echo $conf['view_url'];?>img/favicon.ico">
    <link rel="icon" sizes="32x32" href="<?php echo $conf['view_url'];?>img/favicon.ico">
    <link rel="Bookmark" href="<?php echo $conf['view_url'];?>img/favicon.ico">

    <!--{hook header_bootstrap_before.htm}-->
    <link rel="stylesheet" href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="plugin/xxx_theme_flarum/view/css/flarum.css">
    <link rel="stylesheet" href="plugin/xxx_theme_flarum/view/css/xiuno.css">
    <!--{hook header_bootstrap_after.htm}-->

    <!--{hook header_bootstrap_bbs_before.htm}-->
    <!--{hook header_bootstrap_bbs_after.htm}-->

    <!--{hook header_link_after.htm}-->

</head>

<body>

    <div id="app" class="App affix hasPane App--discussion">
        <!--Off Canvas 遮罩层-->
        <div class="site-overlay"></div>

        <!--{hook header_body_start.htm}-->

        <div id="app-navigation" class="App-navigation">
            <div class="Navigation btnGroup App-backControl">
                <!-- 手机端： 顶部左侧返回按钮-->
                <button class="btn Navigation-back btn-icon hasIcon win-back" title="返回" active="false" type="button">
                    <i class="icon fa fa-chevron-left btn-icon"></i>
                </button>
                <!-- 手机端：版块列表按钮 -->
                <button class="btn btn-icon Navigation-pin hasIcon" type="button">
                    <i class="icon fa fa-thumb-tack btn-icon"></i>
                </button>
            </div>
        </div>

        <div class="App-drawer pushy pushy-left">

            <!--{hook header_nav_start.htm}-->

            <header id="header" class="App-header">
                <div id="header-navigation" class="Header-navigation">
                    <div class="Navigation btnGroup ">
                        <button class="btn Navigation-back btn-icon hasIcon win-back" title="返回" active="false" type="button">
                            <i class="icon fa fa-chevron-left btn-icon"></i>
                        </button>
                        <button class="btn btn-icon Navigation-pin hasIcon" type="button">
                            <i class="icon fa fa-fw fa-thumb-tack btn-icon"></i>
                        </button>
                    </div>
                </div>
                <div class="container">
                    <h1 class="Header-title">

                        <!--{hook header_nav_logo_before.htm}-->

                        <a href="." id="home-link">
                            <img src="plugin/xxx_theme_flarum/view/img/logo.png" alt="<?php echo $header['mobile_title'];?>" class="Header-logo">
                        </a>

                        <!--{hook header_nav_logo_after.htm}-->

                    </h1>
                    <!-- 左侧：版块 -->
                    <div id="nav" class="Header-primary">
                        <ul class="Header-controls">
                            <!--{hook header_nav_forum_start.htm}-->
                            <li class="item-link1" fid="0" data-active="fid-0">
                                <a class="Linksbtn btn btn-link" target="" href="." title="<?php echo lang('index_page');?>"><?php echo lang('index_page');?></a>
                            </li>
                            <!--{hook header_nav_home_link_after.htm}-->

                            <!--{hook header_nav_forumlist_loop_start.htm}-->
                            <li>
                                <a class="Linksbtn btn btn-link" href="###">自己设置</a>
                            </li>
                            <!--{hook header_nav_forumlist_loop_end.htm}-->

                            <!--{hook header_nav_forum_end.htm}-->
                        </ul>
                    </div>
                    <!-- 右侧：用户 -->
                    <div id="header-secondary" class="Header-secondary">
                        <ul class="Header-controls">
                            <!-- 搜索框，需要官方搜索插件 -->
                            <li class="item-search">
                                <div class="Search">
                                    <form action="<?php echo url('search');?>" id="search_form">
                                        <div class="Search-input">
                                            <input class="form-control" type="search" placeholder="<?php echo lang('keyword');?>" name="keyword">
                                        </div>
                                    </form>
                                </div>
                            </li>
                        <?php if(empty($uid)) { ?>
                            <li class="item-logIn">
                                <a class="btn btn-link" href="<?php echo url('user-login');?>" type="button" title="<?php echo lang('login');?>">
                                    <span class="btn-label"><?php echo lang('login');?></span>
                                </a>
                            </li>
                        <?php } else { ?>
                            <!-- 消息通知 -->
                            <li id="nav-usernotice" class="item-notifications usernotice">
                                <div class="btnGroup Dropdown dropdown NotificationsDropdown itemCount0">
                                    <a class="Dropdown-toggle btn btn-flat" href="<?php echo url("my-notice");?>" title="<?php echo lang('notice');?>">
                                        <i class="icon fa fa-bell btn-icon"></i>
                                    <?php if($user['unread_notices'] !=0) { ?>
                                        <span id="nav-usernotice-unread-notices" class="NotificationsDropdown-unread"><?php echo $user['unread_notices']; ?></span>
                                        <span class="btn-label"><?php echo lang('notice');?></span>
                                    <?php } ?>
                                    </a>
                                </div>
                            </li>
                            <li class="item-session">
                                <div class="btnGroup Dropdown dropdown SessionDropdown">
                                    <button class="Dropdown-toggle btn btn-user btn-flat" data-toggle="dropdown">
                                        <img class="Avatar" src="<?php echo $user['avatar_url'];?>">
                                        <span class="btn-label">
                                            <span class="username"><?php echo $user['username'];?></span>
                                        </span>
                                    </button>
                                    <ul class="Dropdown-menu dropdown-menu dropdown-menu-right">
                                        <li class="item-profile">
                                            <a href="<?php echo url('my');?>" active="false" class="hasIcon" type="button" title="个人资料">
                                                <i class="icon fa fa-fw fa-user btn-icon"></i>
                                                <span class="btn-label">个人资料</span>
                                            </a>
                                        </li>
                                        <li class="item-settings">
                                            <a href="<?php echo url('my-thread');?>" active="false" class=" hasIcon" type="button" title="论坛帖子">
                                                <i class="icon fa fa-fw fa-comment btn-icon"></i>
                                                <span class="btn-label">论坛帖子</span>
                                            </a>
                                        </li>
                                        <li class="item-settings">
                                            <a href="<?php echo url("my-favorite");?>" active="false" class=" hasIcon" type="button" title="<?php echo lang('haya_favorite_name'); ?>">
                                                <i class="icon fa fa-fw fa-bookmark btn-icon"></i>
                                                <span class="btn-label"><?php echo lang('haya_favorite_name'); ?> <?php echo intval($user['favorites']);?></span>
                                            </a>
                                        </li>
                                        <li class="Dropdown-separator"></li>
                                        <?php if($gid == 1) { ?>
                                        <li class="item-settings">
                                            <a href="admin/" active="false" class=" hasIcon" type="button" title="Settings">
                                                <i class="icon fa fa-fw fa-cog btn-icon"></i>
                                                <span class="btn-label"><?php echo lang('admin_page');?></span>
                                            </a>
                                        </li>
                                        <?php } ?>
                                        <li class="item-logOut">
                                            <a class="hasIcon" href="<?php echo url('user-logout');?>" type="button" title="<?php echo lang('logout');?>">
                                                <i class="icon fa fa-fw fa-sign-out btn-icon"></i>
                                                <span class="btn-label"><?php echo lang('logout');?></span>
                                            </a>
                                        </li>
                                    </ul>
                                </div>
                            </li>
                        <?php } ?>
                            <!--{hook header_nav_user_end.htm}-->
                        </ul>
                    </div>
                </div>
            </header>
            <!--{hook header_nav_end.htm}-->
        </div>

        <main id="body" class="App-content">
            <!--{hook body_start.htm}-->
